import { Module } from '@nestjs/common';
import { UserModule } from './user/user.module';
import { MongooseModule } from '@nestjs/mongoose';
import { ConfigModule } from '@nestjs/config';
import { AuthModule } from './auth/auth.module';

const ConfigRootModule = ConfigModule.forRoot({
  envFilePath: `.env.${process.env.NODE_ENV}`,
  isGlobal: true,
});

// console.log(process.env.MONGODB_URI);
const DBRootModule = MongooseModule.forRoot(process.env.MONGODB_URI);

@Module({
  imports: [DBRootModule, ConfigRootModule, UserModule, AuthModule],
  controllers: [],
  providers: [],
})
export class AppModule {}
